{% extends 'base.html' %}
{% block title %}
    用户信息修改
{% endblock %}
{% block styles %}
    {{ super() }}
    <style>
        #container {
            width: 900px;
            height: 500px;
            margin: 0 auto;
        }
    </style>
{% endblock %}
{% block newcontent %}
    <div id="container">
    <h3><span style="color: #dc143c; ">{{ msg }}</span></h3>
    {# 如果有文件上传时,必须在form里加上enctype="multipart/form-data" #}
        <form class="form-horizontal" action="{{ url_for('user.user_update') }}" method="post" enctype="multipart/form-data">
            <input type="hidden" name="uid" value="{{ user2.id }}">
            <div class="form-group">
                <label for="username" class="col-sm-2 control-label">用户名</label>
                <div class="col-sm-10">
                    <input type="text" class="form-control" id="username" name="username" value="{{ user2.username }}" disabled>
                </div>
            </div>
            <div class="form-group">
                <label for="password" class="col-sm-2 control-label">密码</label>
                <div class="col-sm-10">
                    <input type="password" class="form-control" id="password" name="password" placeholder="请输入密码">
                </div>
            </div>
            <div class="form-group">
                <label for="phone" class="col-sm-2 control-label">手机号</label>
                <div class="col-sm-10">
                    <input type="text" class="form-control" id="phone" name="phone" value="{{ user2.phone }}" disabled>
                    <span></span>
                </div>
            </div>
            <div class="form-group">
                <label for="email" class="col-sm-2 control-label">邮箱</label>
                <div class="col-sm-10">
                    <input type="text" class="form-control" id="email" name="email" value="{{ user2.email }}">
                </div>
            </div>
            <div class="form-group">
                <label for="exampleInputFile">上传头像</label>
                <input type="file" id="exampleInputFile" name="icon">
                <img src="{% if user2.icon %}{{ url_for('static',filename=user2.icon) }}{% else %}{{ url_for('static',filename='image/touxiang.jpg') }}{% endif %}" alt="" class="img-circle" width="160" height="160">
            </div>
            <div class="form-group">
                <div class="col-sm-offset-2 col-sm-10">
                    <button type="submit" class="btn btn-primary">更新</button>
                </div>
            </div>


        </form>

    </div>
{% endblock %}